package han;

public class J12Fan {

	public static void main(String[] args) {
		Fan yfan = new Fan();
		
		yfan.radius = 10;
		yfan.color ="yellow";
		yfan.speed = yfan.FAST;
		yfan.on= true;
		System.out.println(yfan.toString());
		/*if(yfan.speed == yfan.FAST){
			System.out.println(yfan.a);	
		}else if(yfan.speed ==yfan.MEDIUM){
			System.out.println("중간속도입니다");
		}else{
			System.out.println("최저속도입니다");
		}
		if(yfan.on == true){
			System.out.println("동작중");
		}else{
			System.out.println("정지");
		}*/
		Fan bfan = new Fan();
		 bfan.radius = 5;
		 bfan.color ="blue";
		 bfan.speed =  bfan.MEDIUM;
		 bfan.on= false;
		/*if( bfan.speed ==  bfan.FAST){
			System.out.println();	
		}else if( bfan.speed == bfan.MEDIUM){
			System.out.println("중간속도입니다");
		}else{
			System.out.println("최저속도입니다");
		}
		if(bfan.on == true){
			System.out.println("동작중");
		}else{
			System.out.println("정지");
		}*/
		System.out.println(bfan.toString());
	}//메인

}//클래스
	class Fan{
		final int SLOW=1;
		final int MEDIUM=2;
		final int FAST=3;
		int speed = SLOW;
		boolean on = false;	
		double radius =5.0;
		String color = "blue";
	/*	String a = "최고속도 입니다";
		String b = "중간속도 입니다";
		String c = "최저속도 입니다";*/
		@Override //부모클래스에있는것을 자손클래스에서 다시 정의함
		public String toString() {
			String result = "";
			if(on==true){
			result+=speed+"/"+color+"/"+radius+"/"+"작동중";
			}else
			result+=speed+"/"+color+"/"+radius+"/"+"정지";
			return result;
		}
	}